use serde::Deserialize;
use yew_router::prelude::*;

#[derive(Clone, Routable, PartialEq, Debug)]
pub enum Route {
    #[at("/")]
    Root,
    #[not_found]
    #[at("/404")]
    NotFound,
}

#[derive(Clone, PartialEq, Deserialize, Debug)]
pub struct MediaAttachment {
    pub id: String,
    pub url: String,
    pub preview_url: String
}

#[derive(Clone, PartialEq, Deserialize, Debug)]
pub struct AccountField {
    pub name: String,
    pub value: String,
    pub verified_at: Option<String>
}

#[derive(Clone, PartialEq, Deserialize, Default, Debug)]
pub struct Account {
    pub id: String,
    pub username: String,
    pub acct: String,
    pub display_name: String,
    pub avatar: String,
    pub followers_count: isize,
    pub following_count: isize,
    pub uri: String,
    pub url: String,
    pub note: String,
    pub fields: Vec<AccountField>
}

#[derive(Clone, PartialEq, Deserialize, Debug)]
pub struct Status {
    pub id: String,
    pub created_at: String,
    pub uri: String,
    pub url: String,
    pub content: String,
    pub account: Account,
    pub media_attachments: Vec<MediaAttachment>
}


